﻿using System.Collections.Generic;
using System.ServiceModel;
using System.ServiceModel.Activation;

namespace TaskClient5.Web
{
    [ServiceContract(Namespace = "http://www.cnblogs.com/lemontea/")]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class UserService
    {
        [OperationContract]
        public UserInfo CreateUser(UserInfo user)
        {
            return UserInfo.Create(user);
        }

        [OperationContract]
        public void UpdateUser(UserInfo user)
        {
            UserInfo.Update(user);
        }

        [OperationContract]
        public void Delete(string id)
        {
            UserInfo.Delete(id);
        }

        [OperationContract]
        public List<UserInfo> GetAll()
        {
            return UserInfo.All();
        }

        [OperationContract]
        public UserInfo GetUserById(string id)
        {
            return UserInfo.GetById(id);
        }
    }
}
